package com.z.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.z.sys.entity.Festival;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 节假日管理Mapper接口
 *
 * @author z
 * @date 2023-07-18
 */
@Mapper
public interface FestivalMapper extends BaseMapper<Festival> {
    /**
     * 查询节假日管理列表
     *
     * @param festival 节假日管理
     * @return 节假日管理集合
     */
    List<Festival> selectFestivalList(Festival festival);

    /**
     * 获取节假日和补班日期字符串
     * @param year
     * @return workDay  restDay
     */
    @Select("SELECT GROUP_CONCAT(rest_date) rest_date,GROUP_CONCAT(work_date) work_date FROM t_festival where year = #{year}")
    Festival getWorksAndRests(String year);
}
